Page({
  data:{
    playlists:[]
  },
  onLoad(){
    let url = "http://localhost:8080/"
     wx.request({
      url,
      header: {'content-type':'application/json'},
      method: 'GET',
      dataType: 'json',
      responseType: 'text',
      success: (result)=>{
        let arr = []
       result.data.forEach((item,index)=>{
         let{avatar,username,title,icons,zan,collect} = item;
         arr.push({
           avatar,username,title,icons,zan,collect
         })
       })
       console.log(arr);
       this.setData({
         playlists:arr
       })
      
      },
    });
  },
  handleClick(){
    wx.navigateTo({
      url: '/pages/detail/detail',
      
    });
    
  }
})


